package gov.nasa.anml.lifted;

import java.util.*;

import gov.nasa.anml.PDDL;
import gov.nasa.anml.State;
import gov.nasa.anml.utility.*;

public abstract class Term<L,R extends SimpleObject<? super R>> extends Tuple<L,R> implements Identifier<L,R> {

	// just a "mix-in" class.
	
	// IdentifierImp
	

	
	public int id;
	public SimpleString name;
	
	public Term() {
		super();
		name = null;
		id = -1;
	}
	
	public Term(SimpleString n) {
		super();
		name = n;
		id=-1;
	}
	
	public Term(SimpleString n, int i) {
		super();
		name = n;
		id = i;
	}

	public final Identifier<L,R> id(int id) {
		this.id = id;
		return this;
	}

	public final int id() {
		return this.id;
	}

	public final SimpleString name() {
		return this.name;
	}

	public final Identifier<L,R> name(SimpleString name) {
		this.name = name;
		return this;
	}
	
	public int compareTo(Identifier<L,R> i) {
		return name.compareTo(i.name());
	}
	
	public boolean apply(State p, int contextID, State c) {
		// there shouldn't be a way to apply a term to a state;
		// should have to perform some kind of operation upon the term.
		return false;
	}
	
}
